import { Injectable } from '@angular/core';
import { HttpClient } from '../../../providers/httpClient';
import { Config } from '../../../providers/config';
import _ from 'lodash';
import { FlowParmeter } from '../../draft/detail/flowParmeter.model';
import { Common } from '../../../providers/common';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';


@Injectable()
export class TaskDetailService {

	// "pview": "YES",但是在手机端页面不显示，以下数组保存不显示的fieldid
	// key 为bomid
	hiddenFieldIds = {
		// 出勤变更
		"T_HR_ChuQinBG": ["checktypearray", "checktimearray"],
		"T_HR_ChuChai": ["treserved1", "treserved2"],
		"T_TZ_Inquiry": ["titleid", "sreserved3", "nreserved3", "totalrate", "applydate", "bostime", "issuesprice", "attach", "totalitysuggestion", "bankkh", "bankname", "bankamount", "sgamount", "bmfzryj", "fkidea", "dczidea", "tzzjidea", "cbfund", "cbfk", "ljfund", "ljfk", "islj", "isyjlj", "remittance", "hksm", "outinfo", "remitselected", "issueprice", "iszx", "getcbfk", "getljfk", "cborders", "ljorders", "lockperiod", "ispay", "minissueprice", "autocbfk", "autoljfk", "maxissueprice", "push", "remittancemoney", "ljstatus", "wxsgSfzxLR", "randomFlag", "wxzqInfo", "zqPush", "zqZX", "rationCode", "sy_mrgid", "expCBFund", "HKdate", "HKtime", "explanation"],
		"T_TZ_XGWSRG":["titleid", "nreserved1", "nreserved2", "nreserved3", "sreserved1", "sreserved2", "sreserved3", "isjyzqfh", "bostime", "attach", "dreserved1", "dreserved2", "dreserved3", "BuyInfor", "applydate", "orders", "getfk"]//新股IPO网上申购
	}

	// 在页面不可编辑字段
	disabledFieldIds = {}


	constructor(
		public httpClient: HttpClient,
		public config: Config,
		public flowParmeter: FlowParmeter,
		public common: Common,
		private sanitizer: DomSanitizer
		) { }

	/**
	* [formateBTO5 格式化，让流程意见分行显示]
	* TYPE :BT05 文本域
	*/
	formateBTO5(businessObjectDesList) {
		var that = this;
		var dataList = _.filter(businessObjectDesList, { "type": "BT05" });
		//console.log(dataList);
		_.forEach(dataList, function(data) {
			if (data["fvalue"] != "") {
				data["fvalue"] = data["fvalue"].replace(/\]<br>/g, "]<br><br>");
				that.common.tranformImgLik(data["fvalue"],true).then(function(value:any){ // 设置信任，html 输出
					data["fvalue"] = that.sanitizer.bypassSecurityTrustHtml(value);
				});
			}
		})
	}

	/**
   * [setDepartment 将 fieldid 为'orgid'的节点，转换成起草人所在部门]
   */
   setDepartment(businessObjectDesList) {
   	var orgNode = _.find(businessObjectDesList, { "fieldid": "orgid" });
   	var empNode = _.find(businessObjectDesList, { "fieldid": "empid" });
   	console.log(orgNode);
   	if (orgNode && empNode && empNode["fvalue"]) {
   		this.getContactDetailByEmpid(empNode["fvalue"]).subscribe(data => {
   			if (data) {
   				orgNode["fnameValue"] = data["first_orgname"];
   			}
   		});
   	}
   }



	/**
	 * [setProperty 给每个节点添加是否在页面显示属性,是否可编辑属性]
	 * @param {[type]} listData [businessObjectDesList]
	 * @param {[type]} bomid [businessObjectDesList]
	 */
	 setProperty(listData, bomid) {
	 	var that = this;
		 console.log("##task.service.setProperty 给每个节点添加是否在页面显示属性");
	 	_.forEach(listData, function(data) {
	 		// 设置页面是否显示属性
	 		if (_.indexOf(that.hiddenFieldIds[bomid], data["fieldid"]) > -1) {
	 			data["isShow"] = false;
	 		} else {
	 			data["isShow"] = true;
	 		}
	 		// 设置是否可编辑属性
	 		if (_.indexOf(that.disabledFieldIds[bomid], data["fieldid"]) > -1) {
	 			data["isDisabled"] = true;
	 		} else {
	 			data["isDisabled"] = false;
	 		}
	 	})
	 	return listData;
	 }

	/**
   * [createBGMXNode 构建变更明细节点]
   * @param {[businessObjectDesList]} item [businessObjectDesList]
   */
   createBGMXNode(businessObjectDesList) {
   	//console.log("##task.detai.service");
   	var checktimearray = _.split(_.find(businessObjectDesList, { "fieldid": "checktimearray" })["fvalue"], ",");
   	var checktypearray = _.split(_.find(businessObjectDesList, { "fieldid": "checktypearray" })["fvalue"], ",");
   	var node = {
   		"fieldid": "ext-bgmx",
   		"type": "EXT-BT01",
   		"fname": "变更明细",
   		"fieldidCol": ["checktypearray", "checktimearray"],  // 变更时段fieldid,变更日期feildid
   		"isShow": true, // 是否显示控件
   		"fvalue": {
   			"checktimearray": checktimearray ? checktimearray : [],
   			"checktypearray": checktypearray ? checktypearray : []
   		}
   	}

   	return node;
   }

	/**
	 * [createZcmxNode 资产明细节点]
	 * @param {[type]} bid [description]
	 */
	 createZcmxNode(bid){
	 	var node = {
	 		"fieldid": "ext-zcmx",
	 		"type": "EXT-BT02",
	 		"fname": "资产明细",
	 		"isShow": true, // 是否显示控件
	 		"fvalue": bid
	 	}
	 	return node;
	 }

	/**
	 * [getDetail 详情信息]
	 * @param {[type]} bid [description]
	 */
	 getDetail(bid) {
	 	var that = this;
	 	var retVal = {
	 		"businessObjectDesList": [],
      "backupBusinessObjectDesList": [],
	 		"businessObjectI": {},
	 		"workFlowParmeter": {},
	 		"flowParmeter": {},
      "flowControl": {}
	 	}
	 	var promise = new Promise(function(resolve, reject) {
	 		that.getWorkObject(bid).subscribe(data => {
	 			if (data) {
	 				retVal.businessObjectDesList = data.businessObject;
	 				retVal.businessObjectI = data.businessObjectI;
	 				retVal.workFlowParmeter = data.flowParmeter;
	 				retVal.flowControl = data.flowControl;
	 				_.forEach(data.businessObject, bus => {
            let newobj = {};
            for ( let attr in bus) {
              newobj[attr] = bus[attr];
            }
            retVal.backupBusinessObjectDesList.push(newobj);
          });

	 				// 格式化文本域，处理显示样式，流程意见分行显示
	 				that.formateBTO5(retVal.businessObjectDesList);
	 				// 将 fieldid 为'orgid'的节点，转换成起草人所在部门
	 				that.setDepartment(retVal.businessObjectDesList);

	 				// 变更明细,添加扩展变更明细节点
	 				if (retVal.businessObjectI["bomid"] == "T_HR_ChuQinBG") {
	 					var BGMXNode = that.createBGMXNode(retVal.businessObjectDesList);
	 					retVal.businessObjectDesList = _.concat(retVal.businessObjectDesList, BGMXNode);
	 				}

	 				// 资产明细，添加扩展资产明细节点
	 				if(retVal.businessObjectI["bomid"] == "T_GF_ASSETS_ZCSQ"){
	 					var zcmxNode = that.createZcmxNode(bid);
	 					retVal.businessObjectDesList = _.concat(retVal.businessObjectDesList, zcmxNode);
	 				}

	 				// 给每个节点添加属性 是否显示 是否可编辑
	 				retVal.businessObjectDesList = that.setProperty(retVal.businessObjectDesList, retVal.businessObjectI["bomid"]);

	 				// 出差申请，设置是否显示申请投资系统自由交易授权
	 				if(retVal.businessObjectI["bomid"] == "T_HR_ChuChai"
            || retVal.businessObjectI["bomid"] === "T_HR_QingJia"
            || retVal.businessObjectI["bomid"] === "T_HR_ChuJingSQ" ){
	 					retVal.businessObjectDesList = that.setIsFundMgrProperty(retVal.businessObjectDesList);
	 				}
	 				// 银行间开户流程设置开户类型
	 				if(retVal.businessObjectI["bomid"] == "TPJ_FOS_OPEN_YH"){
	 					retVal.businessObjectDesList = that.setOpenTypeProperty(retVal.businessObjectDesList,retVal.businessObjectI,retVal.workFlowParmeter);
	 				}
	 				// 期货账户开户设置境内镜外
	 				if(retVal.businessObjectI["bomid"] == "TPJ_FOS_OPEN_QHZH"){
	 					retVal.businessObjectDesList = that.setAbroadProperty(retVal.businessObjectDesList);
	 				}
	 				// 产品销户流程设置账户信息
	 				if(retVal.businessObjectI["bomid"] == "TPJ_FOS_CLOSEACCOUNT"){
	 					retVal.businessObjectDesList = that.setCPXHFundinfo(retVal.businessObjectDesList);
	 				}
	 			}
	 			resolve(retVal);
	 		})
	 	}).then(function(argument) {
	 		if (retVal.workFlowParmeter) { // workFlowParmeter 不为空
	 			_.forEach(_.keys(that.flowParmeter), function(key) {
	 				// 在workFlowParmeter中能匹配到值
	 				if (retVal.workFlowParmeter[key] && retVal.workFlowParmeter[key] !="undefined") {
	 					// 初始化flowParmeter值
	 					retVal.flowParmeter[key] = retVal.workFlowParmeter[key];
	 				} else {
	 					retVal.flowParmeter[key] = null;
	 				}
	 			})
	 		}
	 		return retVal;
	 	});

	 	return promise;
	 }

	/**
	 * [getCashPlanDetail 合同申请， 付款计划明细]
	 * @param {[type]} bid [description]
	 * 返回 付款计划数组
	 */
	 getCashPlanDetail(bid) {
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getTaskCashPlan",
	 		"params": {
	 			"bid": bid
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

	/**
	 * [getWorkObject 获得详情信息，包含：文件信息带字段+ 文件信息 + 流程信息]
	 * @param {[type]} bid [文件bid]
	 * 	返回 {
	 *   "businessObject":,
	 *   "businessObjectI":,
	 *   "flowParmeter":
	 * }
	 */
	 getWorkObject(bid) {
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getTaskDetail",
	 		"params": {
	 			"id": bid
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

  /**
   * [insert 更新业务对象]
   * @param {[type]} params [businessObjectDesList]
   */
  updateBusinessObjectDes(bosid, params) {
    let postBody = {
      "module": "BusinessObject",
      "method": "update",
      "params": {
        "loginId": "",
        "bosid": bosid,
        "businessobjectDto": {
          "fieldValueMap": {
            "entry": params
          }
        }
      }
    };

    //console.log(postBody);

    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

	/**
	 * [updateInstance 更新流程实例]
	 * @param {[type]} params [description]
	 */
	 updateInstance(params) {
	 	let postBody = {
	 		"module": "WorkFlow",
	 		"method": "workFlowHandle",
	 		"params": {
	 			"flowParmeterDto": {
	 				"flowdefineid": params.flowdefineid,
	 				"flowProcessId": params.flowProcessId,
	 				"flowCurrWkiId": params.flowCurrWkiId,
	 				"flowCmWkiId": params.flowCmWkiId,
	 				"flownumb": params.flownumb,
	 				"flowNodeInstId": params.flowNodeInstId,
	 				"flowHandleType": params.flowHandleType,
	 				"flowAppointNodeSel": params.flowAppointNodeSel,
	 				"nextNodeEditor": _.toString(params.nextNodeEditor),
	 				"nextNodesRadio": params.nextNodesRadio,
	 				"flowNotion": params.flowNotion,
	 				"flowCountermandNotion": params.flowCountermandNotion,
	 				"flowParentProcessId": params.flowParentProcessId,
	 				"flowStat": params.flowStat,
	 				"flowCopySends": params.flowCopySends,
	 				"flowMainSends": params.flowMainSends,
	 				"flowSendReads": params.flowSendReads,
	 				"bostitle": params.bostitle,
	 				"bomid": params.bomid,
	 				"bid": params.bid,
	 				"loginId": params.loginId,
	 				"authLoginId": params.authLoginId,
	 				"wkPrdid": params.wkPrdid,
	 				"isOther": params.isOther,
	 				"variableMap": params.variableMap,
	 				"indirectNodeMap": params.indirectNodeMap,
	 				"flownotionField": params.flownotionField,
	 				"flowOldNotion": params.flowOldNotion,
	 				"flownotionstyle": params.flownotionstyle,
	 				"flownotioninputstyle": params.flownotioninputstyle,
	 				"flowIsHuiQian": params.flowIsHuiQian,
	 				"flowisAllowMultiEditorV": params.flowisAllowMultiEditorV,
	 				"nextNodeEditorName": _.toString(params.nextNodeEditorName),
	 				"flowCurrNode": params.flowCurrNode,
	 				"clientType": params.clientType,
	 				"flowOrgTitSel": params.flowOrgTitSel
	 			}
	 		}
	 	};

	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

  pushBTA(bosid, attach_id) {
	   let postBody = {
	     "module": "KSB",
       "method": "BTA_030_0120",
       "format": "json",
       "params": {
	       "vc_bosid": bosid,
         "vc_attach_id": attach_id,
         "vc_status": "0"
       }
     };

	   console.log(postBody);
     return this.httpClient.post(postBody, {
       isShowLoading: true
     });
   }

	/**
	 * [updateInfoInstance 更新通知公告]
	 * @param {[type]} params [description]
	 */
	 updateInfoInstance(params) {
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "updateTaskInfoInstance",
	 		"params": {
	 			"type": params.type,  // publish 发布， reject 驳回
	 			"bosid": params.bid,
	 			//"bomid": "t_info_Doc",
	 			"loginId": params.loginId,
	 			"msmodel": params.msmodel, // publish
	 			"wkiState": params.wkiState, // publish 8 reject 1
	 			//"wkiProName": "信息中心",
	 			"wkiUser": params.wkiUser,
	 			"wkiTitle": params.wkiTitle,
	 			//"isOther": false,
	 			"shjl": params.shjl,
	 			"refen": params.refen,
	 			"refenDtos": params.refenDtos,
	 			"needNotice": params.needNotice, // 是否需要送阅
        "readCont": params.readCont,
        "readContName": params.readContName,
        "selectedLoginid": params.selectedLoginid,
        "selectedOrgid": params.selectedOrgid,
        "selectedTitleid": params.selectedTitleid
	 		}
	 	};

	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

	/**
	 * [addApproval 流程送阅提交]
	 * @param {[type]} params [description]
	 */
	 addApproval(params) {
	 	let postBody = {
	 		"module": "WorkFlow",
	 		"method": "flowApproval",
	 		"params": {
	 			"workitemDto": {
	 				"loginId": params.loginId,
	 				"bid": params.bid,
	 				"wkiTitle": params.wkiTitle,
	 				"bomid": params.bomid,
	 				"wkiUser": params.wkiUser,
	 				"wkiDesc": params.wkiDesc,
	 				"isOther": false
	 			}
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

  /**
   * addPress 流程催办提交
   * @param params
   * @returns {any}
   */
  addPress(params) {
    let postBody = {
      "module": "WorkFlow",
      "method": "flowPress",
      "params": {
        "workitemDto": {
          "loginId": params.loginId,
          "bid": params.bid,
          "wkiTitle": params.wkiTitle,
          "bomid": params.bomid,
          "wkiUser": params.wkiUser,
          "wkiDesc": params.wkiDesc,
          "isOther": false
        }
      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

	/**
	 * [getFlowLog 流程日志信息]
	 * @param {[type]} params [{"loginid:","flowProcessId":}]
	 */
	 getFlowLog(params) {
	 	let postBody = {
	 		"module": "WorkFlow",
	 		"method": "getFlowTrackDtos",
	 		"params": {
	 			"loginId": params.loginId,
	 			"flowProcessId": params.flowProcessId
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }


	 // 根据用户empid，获取用户信息
	 getContactDetailByEmpid(id) {
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getContactDetailByLoginid",
	 		"params": {
	 			"empid": id
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: false
	 	});
	 }

	 // 未阅状态改成已阅
	 workitemAsRead(flownumb) {
	 	let postBody = {
	 		"module": "WorkFlow",
	 		"method": "workitemAsRead",
	 		"params": {
	 			"loginId": "",
	 			"flownumb": flownumb
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: false
	 	});
	 }

	 // 获取用户所在的部门、组织
	 getAllOrgmembers(loginid) {
	 	let postBody = {
	 		"module": "Org",
	 		"method": "getAllOrgmembers",
	 		"params": {
	 			"loginId": loginid
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: false
	 	});
	 }

	 // 获得部门父ID，根据orgid 获得 Reorgid
	 getReorgidsByOrgid(orgid) {
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getReorgidsByOrgid",
	 		"params": {
	 			"orgid": orgid
	 		}
	 	};


	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

	 // 获得资产明细
	 getZcmxList(zcbosid){
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getTaskZcmxList",
	 		"params": {
	 			"zcbosid": zcbosid
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }

	 // 获得资产明细
	 getZcmxDeatail(bosid){
	 	let postBody = {
	 		"module": "OAServer",
	 		"method": "getTaskZcmxDeatail",
	 		"params": {
	 			"bosid": bosid
	 		}
	 	};
	 	return this.httpClient.post(postBody, {
	 		isShowLoading: true
	 	});
	 }
	/**
     * [setIsFundMgrProperty 给出差申请流程添加是否在页面显示属性,是否可编辑属性]
     * @param {[type]} listData [businessObjectDesList]
     */
     setIsFundMgrProperty(listData) {
     	let isApplyTZXTQX = _.find(listData, { "fieldid": "isApplyTZXTQX" });
     	if(isApplyTZXTQX["fvalue"]){
     		isApplyTZXTQX["isShow"] = true;
     	}else{
     		isApplyTZXTQX["isShow"] = false;
     	}
     	return listData;
     }

  /**
   * 获取常用批求语
   * @returns {any}
   */
   getMarkedWord() {
   	let postBody = {
   		"module": "OAServer",
   		"method": "getMarkedWord",
   		"params": {

   		}
   	};
   	return this.httpClient.post(postBody, {
   		isShowLoading: false
   	});
   }

  sendSMS(params) {
    let postBody = {
      "module": "OAServer",
      "method": "sendSMS",
      "params": {
        "mobile": params.mobile,
        "content": params.content
      }
    };
    console.log(postBody);
    return this.httpClient.post(postBody, {
      isShowLoading: false
    })
  }

    /**
     * [setOpenTypeProperty 银行间开户流程设置开户类型]
     * @param {[type]} listData [businessObjectDesList]
     */
     setOpenTypeProperty(listData,businessObjectI,workFlowParmeter) {
     	let openType = _.find(listData, { "fieldid": "openType" });
     	let sqs = true;
     	let zzd = true;
     	if(openType){
     		sqs = _.indexOf(openType["fvalue"],'1') > -1;
     		zzd = _.indexOf(openType["fvalue"],'2') > -1;
     		openType["fvalue"] = openType["fvalue"].replace("1","上清所").replace("2","中债登");
     	}
     	_.forEach(listData, function(data) {
     		//设置上清所相关字段是否显示属性
     		if (data["fname"].indexOf("上清所") > -1) {
     			data["isShow"] = sqs;
     		}
     		//设置中债登相关字段是否显示属性
     		if (data["fname"].indexOf("中债登") > -1) {
     			data["isShow"] = zzd;
     		}
     	})

     	//中债登资金账户推送状态BTA
     	let zjPushStatusBta = _.find(listData, { "fieldid": "zjPushStatusBta" });
     	if(zjPushStatusBta){
     		if(zjPushStatusBta["fvalue"]){
     			zjPushStatusBta["fvalue"] = zjPushStatusBta["fvalue"].replace("1","推送成功").replace("2","推送失败");
     		}else{
     			zjPushStatusBta["fvalue"] ="未推送";
     		}
     	}
     	//上清所资金账户推送状态BTA
     	let szjPushStatusBta = _.find(listData, { "fieldid": "szjPushStatusBta" });
     	if(szjPushStatusBta){
     		if(szjPushStatusBta["fvalue"]){
     			szjPushStatusBta["fvalue"] = szjPushStatusBta["fvalue"].replace("1","推送成功").replace("2","推送失败");
     		}else{
     			szjPushStatusBta["fvalue"] ="未推送";
     		}
     	}
     	//字段“是否使用法人名章”是必填项
     	if(workFlowParmeter["flowNotnullfield"]){
     		// TODO: 当前节点不允许未空的字段,需要特殊处理可编辑
     		console.log('当前节点不允许未空的字段:');
     		console.log(workFlowParmeter["flowNotnullfield"]);
     	}
     	return listData;
     }
     /**
     * [setAbroadProperty 期货账户开户流程设置境内境外]
     * @param {[type]} listData [businessObjectDesList]
     */
     setAbroadProperty(listData) {
     	//editStock 股指期货开户要素表编辑权限
     	//editComm 商品期货开户要素表编辑权限
     	//editGrove 国债期货开户要素表编辑权限

     	//境内境外
     	let Abroad = _.find(listData, { "fieldid": "Abroad" });
     	if(Abroad){
     		Abroad["fvalue"] = Abroad["fvalue"].replace("1","境内").replace("2","境外");
     	}
     	//是否附加商品期货开户
     	let isCommTable = _.find(listData, { "fieldid": "isCommTable" });
     	let editStock = _.find(listData, { "fieldid": "editStock" });
     	if(editStock){
     		editStock["type"] = "EXT-BT03";
     	}
     	let editComm = _.find(listData, { "fieldid": "editComm" });
     	if(isCommTable){
     		if(editComm){
     			editComm["isShow"] = isCommTable["fvalue"] == "Y";
     			editComm["type"] = "EXT-BT03";
     		}
     		isCommTable["fvalue"] = isCommTable["fvalue"].replace("Y","是").replace("N","否");
     	}
     	//是否附加国债期货开户
     	let isGroveTable = _.find(listData, { "fieldid": "isGroveTable" });
     	let editGrove = _.find(listData, { "fieldid": "editGrove" });
     	if(isGroveTable){
     		if(editGrove){
     			editGrove["isShow"] = isGroveTable["fvalue"] == "Y";
     			editGrove["type"] = "EXT-BT03";
     		}
     		isGroveTable["fvalue"] = isGroveTable["fvalue"].replace("Y","是").replace("N","否");
     	}
     	//资金帐号初始密码
     	let initPassword = _.find(listData, { "fieldid": "initPassword" });
     	if(initPassword){
     		initPassword["fvalue"] = initPassword["fvalue"].replace("lastnum","公司营业执照后六位").replace("other","其它");
     	}
     	let isUseSeal = _.find(listData, { "fieldid": "isUseSeal" });
     	if(isUseSeal){
     		isUseSeal["fvalue"] = isUseSeal["fvalue"].replace("Y","是").replace("N","否");
     	}
     	return listData;
     }
     /**
     * [setCPXHFundinfo 设置产品销户流程设置超链接]
     * @param {[type]} listData [businessObjectDesList]
     */
     setCPXHFundinfo(listData) {
     	let editFlag = _.find(listData, { "fieldid": "editFlag" });
     	if(editFlag){
     		editFlag["type"] = "EXT-BT03";
     	}
     	return listData;
     }

  getLIQUIDATIONNextEditor(fundCode) {
    let postBody = {
      "module": "OAServer",
      "method": "getLIQUIDATIONNextEditor",
      "params": {
        "fundCode": fundCode
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  getFundPMInfo(id, bomid, fundCode) {
    let postBody = {
      "module": "OAServer",
      "method": "getFundPMInfo",
      "params": {
        "bosid": id,
        "bomid": bomid,
        "fundCode": fundCode
      }
    };

    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  getWorkFlowInfo(userInfo, bosid, bomid) {
    let postBody = {
      "module": "WorkFlow",
      "method": "getWorkFlowInfo",
      "params": {
        "flowParmeterDto": {
          "bomid": bomid,
          "bid": bosid,
          "loginId": userInfo.loginid,
          "isOther": false,
          "authLoginId": userInfo.loginid
        }
      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

  finDeductHrAnnualDay(bosid) {
    let postBody = {
      "module": "CommonTools",
      "method": "finDeductHrAnnualDay",
      "params": {
        "bosid": bosid,
        "satus": "6"
      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

 }
